/*
 * Copyright (C) 拾光分享网 
 * All rights reserved, Designed By www.hiai.top.
 * Email：goodsking@163.com.
 * Version：V1.0.2(20230701).
 */
package top.hiai.my.information;

import com.jfinal.aop.Before;
import com.jfinal.kit.Ret;
import top.hiai.common.interceptor.FrontAuthInterceptor;
import top.hiai.config.BaseController;

/**
* @Author www.hiai.top
* @Email  goodsking@163.com
* @Message 更多资源尽在www.hiai.top
* @Introduction 类的介绍: 用户消息控制器
*/
@Before(FrontAuthInterceptor.class)
public class InformationController extends BaseController {
	
	private InformationService informationService = new InformationService();

	/**
	 * 我的消息
	 * 包含了文章审核的消息，以及处罚消息，可以删除
	 */
	public void list(){
		int accountId = getLoginAccountId();
		setAttr("userAllMsg", informationService.getUserMsgList(getParaToInt("p", 1),limtCount,accountId,2));
		render("my_msg.html");
	}

	/**
	 * 删除一条信息
	 */
	public void deleteByMsg(){
		Ret ret = informationService.deleteByMsg( getParaToInt("nid"));
		redirect("/my/msg/list");
	}

	/**
	 * 系统通知消息
	 */
	public void sys(){
		int accountId = getLoginAccountId();
		setAttr("userAllMsg", informationService.getUserMsgList(getParaToInt("p", 1),limtCount,accountId,1));
		render("my_sys.html");
	}


}